sdsbscompgraph module¶
-
class
sd.api.sbs.sdsbscompgraph.SDSBSCompGraph(APIContext, handle, *args, **kwargs)¶ Bases:
sd.api.sdgraph.SDGraphClass managing a Substance compositing graph
-
compute() → None¶ Compute the SBSGraph. Ensure all graph outputs textures are available and up to date. This function blocks the execution until completion
-
delete() → None¶ Delete the SDResource.
-
deleteGraphObject(sdGraphObj: sd.api.sdgraphobject.SDGraphObject) → None¶ Delete the specified graph object
- Parameters
sdGraphObj – The graph object to delete
-
deleteNode(sdNode: sd.api.sdnode.SDNode) → None¶ Delete the specified node
- Parameters
sdNode – The node to delete
-
deleteProperty(sdProperty: sd.api.sdproperty.SDProperty) → None¶ Delete the specified SDProperty
- Parameters
sdProperty – The property to delete
-
getAnnotationPropertyValueFromId(sdPropertyId: str) → Optional[sd.api.sdvalue.SDValue]¶ Get the value of the annotation property that matches the specified identifier
- Parameters
sdPropertyId – The identifier of the annotation property we want to retrieve
-
getClassName() → str¶ Returns the most specific name of the class this APIObject is
-
getEmbedMethod() → sd.api.sdresource.EmbedMethod¶ Get the method used by this resource to reference its content or file (See EmbedMethod enum)
-
getExposedInSBSAR() → bool¶ Return True if the graph is exposed in SBSAR
-
getFilePath() → str¶ Get the path of the file used by this resource
-
getGraphObjects() → sd.api.sdarray.SDArray[sd.api.sdgraphobject.SDGraphObject][sd.api.sdgraphobject.SDGraphObject]¶ Get all SDGraphObject of the graph
-
getGraphType() → str¶ Helper used to get the type of the graph
-
getIcon() → Optional[sd.api.sdtexture.SDTexture]¶ Helper used to get the icon of the graph
-
getIdentifier() → str¶ Get the resource identifier as string
-
getInputPropertyValueFromId(sdPropertyId: str) → Optional[sd.api.sdvalue.SDValue]¶ Get the value of the input property that matches the specified identifier
- Parameters
sdPropertyId – The identifier of the input property we want to retrieve
-
getMetadataDict() → Optional[sd.api.sdmetadatadict.SDMetadataDict]¶ Get the metadata of this resource as a SDMetadataDict.
-
getNodeDefinitions() → sd.api.sdarray.SDArray[sd.api.sddefinition.SDDefinition][sd.api.sddefinition.SDDefinition]¶ Get all available node definitions for this type of graph
-
getNodeFromId(sdNodeId: str) → Optional[sd.api.sdnode.SDNode]¶ Get the node that matches the specified identifier
- Parameters
sdNodeId – The node identifier
-
getNodes() → sd.api.sdarray.SDArray[sd.api.sdnode.SDNode][sd.api.sdnode.SDNode]¶ Get all nodes of this graph
-
getOutputNodes() → sd.api.sdarray.SDArray[sd.api.sdnode.SDNode][sd.api.sdnode.SDNode]¶ Get the list of all output nodes of the graph
-
getPackage() → SDPackage¶ Get the SDPackage the current SDResource belongs to.
-
getProperties(sdPropertyCategory: sd.api.sdproperty.SDPropertyCategory) → sd.api.sdarray.SDArray[sd.api.sdproperty.SDProperty][sd.api.sdproperty.SDProperty]¶ Get all properties of the specified category (Input, Output or Annotation)
- Parameters
sdPropertyCategory – The enum value the indicate which type of properties to get
-
getPropertyAnnotationValueFromId(sdProperty: sd.api.sdproperty.SDProperty, sdPropertyAnnotationId: str) → Optional[sd.api.sdvalue.SDValue]¶ Get the property annotation value of the specified property
- Parameters
sdProperty – The property we want to retrieve the annotation value from
sdPropertyAnnotationId – The identifier of the annotation to retrieve
-
getPropertyAnnotations(sdProperty: sd.api.sdproperty.SDProperty) → sd.api.sdarray.SDArray[sd.api.sdproperty.SDProperty][sd.api.sdproperty.SDProperty]¶ Get the annotation properties of the specified property
- Parameters
sdProperty – The SDProperty to retrieve the annotations from
-
getPropertyFromId(sdPropertyId: str, sdPropertyCategory: sd.api.sdproperty.SDPropertyCategory) → Optional[sd.api.sdproperty.SDProperty]¶ Get property that match the specified identifier in the specified category
- Parameters
sdPropertyId – The identifier of the property we want to retrieve
sdPropertyCategory – The category of the property
-
getPropertyInheritanceMethod(sdProperty: sd.api.sdproperty.SDProperty) → sd.api.sdproperty.SDPropertyInheritanceMethod¶ For graph properties that support it, retrieve the inheritance method of the specified property. See ‘SDPropertyInheritanceMethod’
- Parameters
sdProperty – The property we want to query the inheritance method
-
getPropertyMetadataDictFromId(sdPropertyId: str, sdPropertyCategory: sd.api.sdproperty.SDPropertyCategory) → Optional[sd.api.sdmetadatadict.SDMetadataDict]¶ Get the metadata of the property that matches the specified identifier in the specified category as a SDMetadataDict.
- Parameters
sdPropertyId – The identifier of the property we want to retrieve
sdPropertyCategory – The category of the property
-
getPropertyValue(sdProperty: sd.api.sdproperty.SDProperty) → Optional[sd.api.sdvalue.SDValue]¶ Get the value of a property
- Parameters
sdProperty – The property we want to retrieve the value from
-
getPropertyValueFromId(sdPropertyId: str, sdPropertyCategory: sd.api.sdproperty.SDPropertyCategory) → Optional[sd.api.sdvalue.SDValue]¶ Get the value of the property that matches the specified identifier in the specified category
- Parameters
sdPropertyId – The identifier of the property we want to retrieve
sdPropertyCategory – The category of the property
-
getType() → Optional[sd.api.sdtype.SDType]¶ Get the resource type as SDType
-
getUID() → str¶ Helper used to get the UID of the graph
-
getUrl() → str¶ Retrieve the resource URL
-
newInstanceNode(sdResourceToInstantiate: sd.api.sdresource.SDResource) → Optional[sd.api.sdnode.SDNode]¶ Create a new instance node from the specified resource
- Parameters
sdResourceToInstantiate – The resource to instantiate
-
newNode(sdDefinitionId: str) → Optional[sd.api.sdnode.SDNode]¶ Create a new node
- Parameters
sdDefinitionId – The identifier of the SDDefinition of the node to create
-
newProperty(sdPropertyId: str, sdPropertyType: sd.api.sdtype.SDType, sdPropertyCategory: sd.api.sdproperty.SDPropertyCategory) → Optional[sd.api.sdproperty.SDProperty]¶ Create a new SDProperty of the specified type and in the specified SDPropertyCategory
- Parameters
sdPropertyId – The identifier of the new property
sdPropertyType – The type of the new property
sdPropertyCategory – The SDPropertyCategory of the new property to create
-
release() → None¶ Releases an APIObject
-
static
sNew(parent: sd.api.sdapiobject.SDAPIObject) → sd.api.sbs.sdsbscompgraph.SDSBSCompGraph¶ Create a new SDSBSCompGraph under the specified parent
- Parameters
parent – The parent data that will contains the newly created compositing graph. Can be SDPackage or SDResourceFolder
-
static
sNewFromFile(parent: sd.api.sdapiobject.SDAPIObject, filePath: str, embedMethod: sd.api.sdresource.EmbedMethod) → sd.api.sdresource.SDResource¶ Create a new SDResource from the specified file. The resource may reference or copy the file content depending on the EmbedMethod
- Parameters
parent – The parent data that will contains the newly created resource. Can be SDPackage or SDResourceFolder
filePath – The file path
embedMethod – The embed method
-
setAnnotationPropertyValueFromId(sdAnnotationPropertyId: str, sdValue: sd.api.sdvalue.SDValue) → None¶ Set the value of the specified annotation property retrieved by his identifier
- Parameters
sdAnnotationPropertyId – The identifier of the annotation property
sdValue – The value to set
-
setIcon(sdTexture: sd.api.sdtexture.SDTexture) → None¶ Helper used to set the icon of the graph
- Parameters
sdTexture – The texture that will be used as icon
-
setIdentifier(identifier: str) → None¶ Set the resource identifier
- Parameters
identifier – The new resource identifier
-
setInputPropertyValueFromId(sdInputPropertyId: str, sdValue: sd.api.sdvalue.SDValue) → None¶ Set the value of the specified input property retrieved by his identifier
- Parameters
sdInputPropertyId – The identifier of the input property
sdValue – The value to set
-
setOutputNode(sdNode: sd.api.sdnode.SDNode, isOutput: bool) → None¶ Set/Unset the specified node as an output node of the graph
- Parameters
sdNode – The node to set/unset as an output node
isOutput – Indicates whether the specified node is an output node
-
setPropertyAnnotationValueFromId(sdProperty: sd.api.sdproperty.SDProperty, sdPropertyAnnotationId: str, sdValue: sd.api.sdvalue.SDValue) → None¶ Set the property annotation value of the specified property
- Parameters
sdProperty – The property whose we want to change the annotation value
sdPropertyAnnotationId – The identifier of the annotation to set
sdValue – The SDValue to set
-
setPropertyInheritanceMethod(sdProperty: sd.api.sdproperty.SDProperty, inheritanceMethod: sd.api.sdproperty.SDPropertyInheritanceMethod) → None¶ For graph properties that support it, set the inheritance method of the specified property. See ‘SDPropertyInheritanceMethod’
- Parameters
sdProperty – The property we want to set the inheritance method
inheritanceMethod – The inheritance method to set on the property
-
setPropertyValue(sdProperty: sd.api.sdproperty.SDProperty, sdValue: sd.api.sdvalue.SDValue) → None¶ Set the value of the specified property
- Parameters
sdProperty – The property we want to retrieve the value from
sdValue – The value to set
-